The present invention relates generally to information processing systems and more particularly to a methodology and implementation for providing an increased number of threads in a process.
UNIX-based operating systems schedule execution of various user processes on one or more microprocessors within the computing system. A user process includes a set of system resources for executing one or more xe2x80x9cthreadsxe2x80x9d. A thread is a simple execution path through application software and the operating system. Stated differently, a thread is a separate sequential flow of control that takes place during the execution of a data processing program or application. A thread may also be described as the active execution of a designated data processing routine, including any nested routine invocations. Kernels or kernel threads are control flows which enable concurrent processing of a procedure by a plurality of processors thereby dividing a task to be performed into parts and decreasing the task execution time. Multi-threading can be used in single processor systems to perform several tasks at the same time such as input monitoring and computation execution. Multi-threading can also be used in multi-processor systems to perform several control flows or threads in parallel.
In order to maintain data integrity while multiple threads are running in parallel and manipulating common data, such systems have in the past required highly sophisticated management systems for data tracking. In the past, if an application sought to exceed a common 513 thread limit, it had to be spaced out over multiple processes which creates a problem because the user thread programming model didn""t support multiple processes accessing the same data structures. Application developers have been forced to develop their own non-portable kernel extensions to bridge the gap between the processes, which is an extremely difficult programming task, because the internals of the thread programming model are mostly hidden from third party developers. For example, simply referencing global memory can become difficult if applications are allowed to map shared memory at different locations or through mapped files.
Thus, there is a need for an improved methodology and implementing system which enables a simpler application programming model, having improved application scalability, which allows more concurrent input/output throughput and greater application portability.
A method and implementing computer system is provided for the creation of large numbers of threads in a computer system. An exemplary embodiment supports up to sixteen segments in memory of thread private data for each process or application program running on the system. Each segment contains support for 2K threads. These segments are identified in process"" user structure which is located in the process private data segment of memory allowing cleanup collection on a per-segment basis. The thread""s private data is composed of two parts, viz. its private kernel thread stack (96K) and uthread data structure. The uthread contains the individual data fields that are referenced only by the thread, including the register save area for the thread.